package com.xxx.user.mq;

import com.xxx.common.base.constants.RocketMqKey;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;


@Slf4j
@Component
@AllArgsConstructor
@RocketMQMessageListener(topic = RocketMqKey.TEST_TOPIC,
        consumerGroup = "${rocketmq.consumer.group}" + "-" + RocketMqKey.TEST_TOPIC,
        messageModel = MessageModel.CLUSTERING)
public class TestConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        System.out.println(message);
    }

}